<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highsecondary" content="no">
    <meta name="viewport" content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width">

    <title>询价列表 -采方</title>
    <link href="../lib/fonts/material-icons.css?family=Material+Icons" rel="stylesheet">
    <link href="../lib/css/animate.min.css" rel="stylesheet">
    <link href="../lib/css/quasar.mat.rtl.min.css" rel="stylesheet" type="text/css">
    <style>
      [v-cloak] { display: none }
    </style>
  </head>
  <body>
    <div id="q-rfxPurList" v-cloak>
      <q-layout>
        <q-page-container>
          <q-tabs inverted color="primary" v-model="selectedTab">
            <q-tab slot="title" name="tab-1" label="未发布"></q-tab>
            <q-tab slot="title" name="tab-2" label="已发布"></q-tab>
            <q-tab slot="title" name="tab-3" label="已关闭"></q-tab>

            <q-tab-pane name="tab-1" class="q-pa-none">
              <q-card class="bg-white no-shadow full-width">
                <q-card-main class="q-px-md q-py-sm relative-position">
                  <div class="row justify-start gutter-sm q-px-sm">
                    <q-field class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                      <q-input
                        :float-label="$t('编码')"
                        v-model.trim="searchForm.code"></q-input>
                    </q-field>
                    <q-field class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                      <q-input
                        :float-label="$t('主题')"
                        v-model.trim="searchForm.title"></q-input>
                    </q-field>
                    <q-field class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                      <q-input
                        :float-label="$t('SOR编码')"
                        v-model.trim="searchForm.sorCode"></q-input>
                    </q-field>
                  </div>
                  <div class="row justify-end q-my-sm">
                    <q-btn
                      size="sm"
                      push
                      color="primary"
                      :loading="btnLoadingSearch"
                      @click="search"
                      class="q-mt-sm q-mr-sm q-pa-sm">
                      <span slot="loading">
                        <q-spinner-hourglass></q-spinner-hourglass>
                        搜索中
                      </span>
                      <q-icon name="search"></q-icon>
                      <span>{{ $t('查询') }}</span>
                    </q-btn>
                    <q-btn
                      size="sm"
                      push
                      color="secondary"
                      :loading="btnLoadingReset"
                      @click="reset"
                      class="q-mt-sm q-mr-sm q-pa-sm">
                      <span slot="loading">
                        <q-spinner-hourglass></q-spinner-hourglass>
                        重置中
                      </span>
                      <q-icon name="refresh" ></q-icon>
                      <span>{{ $t('重置') }}</span>
                    </q-btn>
                  </div>
                  <q-table
                    class="no-shadow"
                    :data="tableData"
                    dense
                    hide-bottom
                    :columns="columnsOne"
                    :rows-per-page-options="[5, 10, 20]"
                    selection="multiple"
                    :loading="listLoading"
                    :selected.sync="selectedOne"
                    :pagination.sync="serverPagination"
                    @request="listGet"
                    row-key="id"
                  >
                    <template slot="top-left" slot-scope="props">
                      <q-btn
                        color="primary"
                        outline
                        size="xs"
                        :label="$t('新增')"
                        @click="goMaintenance(1)"
                        class="q-mr-sm" ></q-btn>
                      <!-- <q-btn
                        color="primary"
                        outline
                        size="xs"
                        :label="$t('导出')"
                        class="q-mr-sm"></q-btn> -->
                      <q-btn
                        color="primary"
                        outline
                        size="xs"
                        :label="$t('激活')"
                        @click="activate"
                        class="q-mr-sm"></q-btn>
                      <q-btn
                        color="negative"
                        outline
                        size="xs"
                        :label="$t('删除')"
                        @click="deleteOne"
                        class="q-mr-sm"></q-btn>
                    </template>
                    <template slot="body" slot-scope="props">
                      <q-tr
                        :props="props"
                      >
                        <q-td >
                          <q-checkbox color="primary" v-model="props.selected"></q-checkbox>
                        </q-td>
                        <q-td key="action" :props="props" >
                          <q-btn
                            flat
                            size="xs"
                            color="primary"
                            class="q-pa-xs"
                            @click="goMaintenance(2, props.row.id)"
                          >
                            {{ $t('编辑') }}
                          </q-btn>
                          <!-- <q-btn 
                            flat
                            size="xs"
                            color="primary"
                            class="q-pa-xs"
                            @click="props.expand = !props.expand"
                          >
                            {{ props.expand == true? '收起': '更多' }}
                          </q-btn> -->
                        </q-td>
                        <q-td key="code" :props="props" >
                          <a href="javascript:;" class="text-primary" @click="window.location.href='./rfxPurPreview.html?id='+props.row.id">{{ props.row.code }}</a>
                        </q-td>
                        <q-td key="title" :props="props" >
                          {{ props.row.title }}
                        </q-td>
                        <q-td key="origin" :props="props" >
                          {{ props.row.origin == 1? '手工': 'SOR' }}
                        </q-td>
                        <q-td key="isOfficial" :props="props" >
                          <q-chip v-if="props.row.isOfficial == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isOfficial == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="isSeal" :props="props" >
                          <q-chip v-if="props.row.isSeal == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isSeal == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="isSignUp" :props="props" >
                          <q-chip v-if="props.row.isSignUp == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isSignUp == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="signUpStartTime" :props="props" >
                          {{ props.row.signUpStartTime }}
                        </q-td>
                        <q-td key="signUpEndTime" :props="props" >
                          {{ props.row.signUpEndTime }}
                        </q-td>
                        <q-td key="approveStatus" :props="props" >
                          <q-chip v-if="props.row.approveStatus == 0" dense square color="light">未审核</q-chip>
                          <q-chip v-if="props.row.approveStatus == 1" dense square color="positive">通过</q-chip>
                          <q-chip v-if="props.row.approveStatus == -1" dense square color="negative">驳回</q-chip>
                        </q-td>
                        <q-td key="isClose" :props="props" >
                          <q-chip v-if="props.row.isClose == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isClose == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="status" :props="props" >
                          <q-chip v-if="props.row.status == 1" dense square color="positive">激活</q-chip>
                          <q-chip v-if="props.row.status == 0" dense square color="light">草稿</q-chip>
                        </q-td>
                        <q-td key="sorCode" :props="props" >
                          {{ props.row.sorCode }}
                        </q-td>
                        <q-td key="proposerName" :props="props" >
                          {{ props.row.proposerName }}
                        </q-td>
                        <q-td key="requiredFinishTime" :props="props" >
                          {{ props.row.requiredFinishTime }}
                        </q-td>
                        <q-td key="purExecutorName" :props="props" >
                          {{ props.row.purExecutorName }}
                        </q-td>
                        <q-td key="createTime" :props="props" >
                          {{ props.row.createTime }}
                        </q-td>
                        <q-td key="createUserName" :props="props" >
                          {{ props.row.createUserName }}
                        </q-td>
                      </q-tr>
                      <q-tr v-show="props.expand" :props="props">
                        <q-td colspan="100%">
                          审核原因：{{ props.row.approveReason }}
                        </q-td>
                      </q-tr>
                    </template>
                  </q-table>
                  <div class="row justify-end items-center text-faded">
                    每页的行数：
                    <q-select 
                      :options="[{label: '5', value: 5},{label: '10', value: 10},{label: '20', value: 20}]" 
                      hide-underline
                      class="q-mr-md"
                      v-model="serverPagination.rowsPerPage"></q-select>
                    第
                    <q-pagination
                      class="q-mt-xs"
                      v-model="serverPagination.page"
                      input
                      boundary-links
                      direction-links
                      :max-pages="5"
                      :ellipses="true"
                      :max="pages"></q-pagination>
                    页 &nbsp; 共 {{ total }} 条
                  </div>
                  <q-inner-loading :visible="visible">
                    <q-spinner-gears size="50px" color="primary"></q-spinner-gears>
                  </q-inner-loading>
                </q-card-main>
              </q-card>
            </q-tab-pane>
            <q-tab-pane name="tab-2" class="q-pa-none">
              <q-card class="bg-white no-shadow full-width">
                <q-card-main class="q-px-md q-py-sm relative-position">
                  <div class="row justify-start gutter-sm q-px-sm">
                    <q-field class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                      <q-input
                        :float-label="$t('编码')"
                        v-model.trim="searchForm.code"></q-input>
                    </q-field>
                    <q-field class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                      <q-input
                        :float-label="$t('主题')"
                        v-model.trim="searchForm.title"></q-input>
                    </q-field>
                    <q-field class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                      <q-input
                        :float-label="$t('SOR编码')"
                        v-model.trim="searchForm.sorCode"></q-input>
                    </q-field>
                  </div>
                  <div class="row justify-end q-my-sm">
                    <q-btn
                      size="sm"
                      push
                      color="primary"
                      @click="search"
                      class="q-mt-sm q-mr-sm q-pa-sm">
                      <span slot="loading">
                        <q-spinner-hourglass></q-spinner-hourglass>
                        搜索中
                      </span>
                      <q-icon name="search"></q-icon>
                      <span>{{ $t('查询') }}</span>
                    </q-btn>
                    <q-btn
                      size="sm"
                      push
                      color="secondary"
                      @click="reset"
                      class="q-mt-sm q-mr-sm q-pa-sm">
                      <span slot="loading">
                        <q-spinner-hourglass></q-spinner-hourglass>
                        重置中
                      </span>
                      <q-icon name="refresh" ></q-icon>
                      <span>{{ $t('重置') }}</span>
                    </q-btn>
                  </div>
                  <q-table
                    class="no-shadow"
                    :data="tableData"
                    dense
                    hide-bottom
                    :columns="columnsTwo"
                    :rows-per-page-options="[5, 10, 20]"
                    selection="multiple"
                    :loading="listLoading"
                    :selected.sync="selectedTwo"
                    :pagination.sync="serverPagination"
                    row-key="id"
                  >
                    <template slot="top-left" slot-scope="props">
                      <q-btn
                        color="negative"
                        outline
                        size="xs"
                        :label="$t('关闭')"
                        @click="close"
                        class="q-mr-sm"></q-btn>
                    </template>
                    <template slot="body" slot-scope="props">
                      <q-tr
                        :props="props"
                      >
                        <q-td >
                          <q-checkbox color="primary" v-model="props.selected"></q-checkbox>
                        </q-td>
                        <q-td key="action" :props="props" >
                          <q-btn
                            flat
                            size="xs"
                            color="primary"
                            class="q-pa-xs"
                            @click="window.location.href='rfxPurPreview.html?id=' + props.row.id"
                          >
                            {{ $t('查看') }}
                          </q-btn>
                          <q-btn
                            flat
                            size="xs"
                            color="primary"
                            class="q-pa-xs"
                            @click="comparePrice(props.row.isSeal, props.row.id)"
                          >
                            {{ $t('比价分析') }}
                          </q-btn>
                          <!-- <q-btn 
                            flat
                            size="xs"
                            color="primary"
                            class="q-pa-xs"
                            @click="props.expand = !props.expand"
                          >
                            {{ props.expand == true? '收起': '更多' }}
                          </q-btn> -->
                        </q-td>
                        <q-td key="code" :props="props" >
                          {{ props.row.code }}
                        </q-td>
                        <q-td key="title" :props="props" >
                          {{ props.row.title }}
                        </q-td>
                        <q-td key="origin" :props="props" >
                          {{ props.row.origin == 1? '手工': 'SOR' }}
                        </q-td>
                        <q-td key="isOfficial" :props="props" >
                          <q-chip v-if="props.row.isOfficial == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isOfficial == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="isSeal" :props="props" >
                          <q-chip v-if="props.row.isSeal == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isSeal == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="isSignUp" :props="props" >
                          <q-chip v-if="props.row.isSignUp == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isSignUp == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="signUpStartTime" :props="props" >
                          {{ props.row.signUpStartTime }}
                        </q-td>
                        <q-td key="signUpEndTime" :props="props" >
                          {{ props.row.signUpEndTime }}
                        </q-td>
                        <q-td key="signUpView" :props="props" >
                          {{ props.row.signUpView }}
                        </q-td>
                        <q-td key="quoteView" :props="props" >
                          {{ props.row.quoteView }}
                        </q-td>
                        <q-td key="approveStatus" :props="props" >
                          <q-chip v-if="props.row.approveStatus == 0" dense square color="light">未审核</q-chip>
                          <q-chip v-if="props.row.approveStatus == 1" dense square color="positive">通过</q-chip>
                          <q-chip v-if="props.row.approveStatus == -1" dense square color="negative">驳回</q-chip>
                        </q-td>
                        <q-td key="isClose" :props="props" >
                          <q-chip v-if="props.row.isClose == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isClose == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="status" :props="props" >
                          <q-chip v-if="props.row.status == 1" dense square color="positive">激活</q-chip>
                          <q-chip v-if="props.row.status == 0" dense square color="light">草稿</q-chip>
                        </q-td>
                        <q-td key="sorCode" :props="props" >
                          {{ props.row.sorCode }}
                        </q-td>
                        <q-td key="createTime" :props="props" >
                          {{ props.row.createTime }}
                        </q-td>
                        <q-td key="createUserName" :props="props" >
                          {{ props.row.createUserName }}
                        </q-td>
                      </q-tr>
                      <q-tr v-show="props.expand" :props="props">
                        <q-td colspan="100%">
                          审核原因：{{ props.row.approveReason }}
                        </q-td>
                      </q-tr>
                    </template>
                  </q-table>
                  <div class="row justify-end items-center text-faded">
                    每页的行数：
                    <q-select 
                      :options="[{label: '5', value: 5},{label: '10', value: 10},{label: '20', value: 20}]" 
                      hide-underline
                      class="q-mr-md"
                      v-model="serverPagination.rowsPerPage"></q-select>
                    第
                    <q-pagination
                      class="q-mt-xs"
                      v-model="serverPagination.page"
                      input
                      boundary-links
                      direction-links
                      :max-pages="5"
                      :ellipses="true"
                      :max="pages"></q-pagination>
                    页 &nbsp; 共 {{ total }} 条
                  </div>
                  <q-inner-loading :visible="visible">
                    <q-spinner-gears size="50px" color="primary"></q-spinner-gears>
                  </q-inner-loading>
                </q-card-main>
              </q-card>
            </q-tab-pane>
            <q-tab-pane name="tab-3" class="q-pa-none">
              <q-card class="bg-white no-shadow full-width">
                <q-card-main class="q-px-md q-py-sm relative-position">
                  <div class="row justify-start gutter-sm q-px-sm">
                    <q-field class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                      <q-input
                        :float-label="$t('编码')"
                        v-model.trim="searchForm.code"></q-input>
                    </q-field>
                    <q-field class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                      <q-input
                        :float-label="$t('主题')"
                        v-model.trim="searchForm.title"></q-input>
                    </q-field>
                    <q-field class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                      <q-input
                        :float-label="$t('SOR编码')"
                        v-model.trim="searchForm.sorCode"></q-input>
                    </q-field>
                  </div>
                  <div class="row justify-end q-my-sm">
                    <q-btn
                      size="sm"
                      push
                      color="primary"
                      @click="search"
                      class="q-mt-sm q-mr-sm q-pa-sm">
                      <span slot="loading">
                        <q-spinner-hourglass></q-spinner-hourglass>
                        搜索中
                      </span>
                      <q-icon name="search"></q-icon>
                      <span>{{ $t('查询') }}</span>
                    </q-btn>
                    <q-btn
                      size="sm"
                      push
                      color="secondary"
                      @click="reset"
                      class="q-mt-sm q-mr-sm q-pa-sm">
                      <span slot="loading">
                        <q-spinner-hourglass></q-spinner-hourglass>
                        重置中
                      </span>
                      <q-icon name="refresh" ></q-icon>
                      <span>{{ $t('重置') }}</span>
                    </q-btn>
                  </div>
                  <q-table
                    class="no-shadow"
                    :data="tableData"
                    dense
                    hide-bottom
                    :columns="columnsThree"
                    :rows-per-page-options="[5, 10, 20]"
                    selection="multiple"
                    :loading="listLoading"
                    :selected.sync="selectedThree"
                    :pagination.sync="serverPagination"
                    row-key="id"
                  >
                    <template slot="body" slot-scope="props">
                      <q-tr
                        :props="props"
                      >
                        <q-td >
                          <q-checkbox color="primary" v-model="props.selected"></q-checkbox>
                        </q-td>
                        <q-td key="action" :props="props" >
                          <q-btn
                            flat
                            size="xs"
                            color="primary"
                            class="q-pa-xs"
                            @click="window.location.href = 'rfxPurPreview.html?id='+props.row.id"
                          >
                            {{ $t('查看') }}
                          </q-btn>
                          <!-- <q-btn 
                            flat
                            size="xs"
                            color="primary"
                            class="q-pa-xs"
                            @click="props.expand = !props.expand"
                          >
                            {{ props.expand == true? '收起': '更多' }}
                          </q-btn> -->
                        </q-td>
                        <q-td key="code" :props="props" >
                          {{ props.row.code }}
                        </q-td>
                        <q-td key="title" :props="props" >
                          {{ props.row.title }}
                        </q-td>
                        <q-td key="origin" :props="props" >
                          {{ props.row.origin == 1? '手工': 'SOR' }}
                        </q-td>
                        <q-td key="isOfficial" :props="props" >
                          <q-chip v-if="props.row.isOfficial == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isOfficial == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="isSeal" :props="props" >
                          <q-chip v-if="props.row.isSeal == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isSeal == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="isSignUp" :props="props" >
                          <q-chip v-if="props.row.isSignUp == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isSignUp == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="signUpStartTime" :props="props" >
                          {{ props.row.signUpStartTime }}
                        </q-td>
                        <q-td key="signUpEndTime" :props="props" >
                          {{ props.row.signUpEndTime }}
                        </q-td>
                        <q-td key="signUpView" :props="props" >
                          {{ props.row.signUpView }}
                        </q-td>
                        <q-td key="quoteView" :props="props" >
                          {{ props.row.quoteView }}
                        </q-td>
                        <q-td key="approveStatus" :props="props" >
                          <q-chip v-if="props.row.approveStatus == 0" dense square color="light">未审核</q-chip>
                          <q-chip v-if="props.row.approveStatus == 1" dense square color="positive">通过</q-chip>
                          <q-chip v-if="props.row.approveStatus == -1" dense square color="negative">驳回</q-chip>
                        </q-td>
                        <q-td key="isClose" :props="props" >
                          <q-chip v-if="props.row.isClose == 1" dense square color="positive">是</q-chip>
                          <q-chip v-if="props.row.isClose == 0" dense square color="light">否</q-chip>
                        </q-td>
                        <q-td key="status" :props="props" >
                          <q-chip v-if="props.row.status == 1" dense square color="positive">激活</q-chip>
                          <q-chip v-if="props.row.status == 0" dense square color="light">草稿</q-chip>
                        </q-td>
                        <q-td key="sorCode" :props="props" >
                          {{ props.row.sorCode }}
                        </q-td>
                        <q-td key="requiredFinishTime" :props="props" >
                          {{ props.row.requiredFinishTime }}
                        </q-td>
                        <q-td key="purExecutorName" :props="props" >
                          {{ props.row.purExecutorName }}
                        </q-td>
                        <q-td key="createTime" :props="props" >
                          {{ props.row.createTime }}
                        </q-td>
                        <q-td key="createUserName" :props="props" >
                          {{ props.row.createUserName }}
                        </q-td>
                      </q-tr>
                      <q-tr v-show="props.expand" :props="props">
                        <q-td colspan="100%">
                          审核原因：{{ props.row.approveReason }}
                        </q-td>
                      </q-tr>
                    </template>
                  </q-table>
                  <div class="row justify-end items-center text-faded">
                    每页的行数：
                    <q-select 
                      :options="[{label: '5', value: 5},{label: '10', value: 10},{label: '20', value: 20}]" 
                      hide-underline
                      class="q-mr-md"
                      v-model="serverPagination.rowsPerPage"></q-select>
                    第
                    <q-pagination
                      class="q-mt-xs"
                      v-model="serverPagination.page"
                      input
                      boundary-links
                      direction-links
                      :max-pages="5"
                      :ellipses="true"
                      :max="pages"></q-pagination>
                    页 &nbsp; 共 {{ total }} 条
                  </div>
                  <q-inner-loading :visible="visible">
                    <q-spinner-gears size="50px" color="primary"></q-spinner-gears>
                  </q-inner-loading>
                </q-card-main>
              </q-card>
            </q-tab-pane>
          </q-tabs>
        </q-page-container>
      </q-layout>
    </div>
    
    <!-- ie-polyfill 、 vue.js and quasar-framework -->
    <script src="../lib/js/quasar.ie.polyfills.umd.min.js"></script>
    <script src="../lib/js/vue.js"></script>
    <script src="../lib/js/quasar.mat.umd.min.js"></script>
    <!-- babel for es6 transform -->
    <!-- <script src="lib/js/babel.min.js"></script> -->
    <!-- vue validate -->
    <script src="../lib/js/vuelidate.min.js"></script>
    <script src="../lib/js/validators.min.js"></script>
    <!-- consts and utils ps: always leave this file first -->
    <script src="../script/consts.js"></script>
    <script src="../script/utils.js"></script>
    <!-- status code -->
    <script src="../script/status.code.js"></script>
    <!-- qs for axios -->
    <script src="../lib/js/qs.min.js"></script>
    <!-- axios for http request -->
    <script src="../lib/js/axios.js"></script>
    <!-- axios.instance must be after axios -->
    <script src="../script/axios.instance2.js"></script>
    <!-- quasar i18n zh-hans -->
    <script src="../lib/lang/zh-hans.js"></script>
    <!-- vue-i18n for application's internationalization -->
    <script src="../lib/js/vue-i18n.js"></script>
    <!-- current page international file -->
    <script src="../lang/sor/rfxPurList.js"></script>

    <script>
			// quasar components use
      Quasar.i18n.set(Quasar.i18n[LANGUGE])
      Vue.prototype.window = window
			new Vue({
        el: '#q-rfxPurList',
        i18n: i18n,
				data: function() {
					return {
            // 通用
            selectedTab: 'tab-1',
            visible: false,
            listLoading: false,
            btnLoadingReset: false,
            btnLoadingSearch: false,
            tableData: [],
            serverPagination: {
              page: 1,
              rowsPerPage: 10,
              rowsNumber: 10
            },
            total: 0,
            searchForm: {
              code: '',
              title: '',
              sorCode: ''
            },
            tabSearch: {
              key: 'status',
              val: 0
            },
            options: [],
            // tab-1
            moreSearchOne: false,
            selectedOne: [],
            // tab-2
            moreSearchTwo: false,
            selectedTwo: [],
            // tab-3
            moreSearchThree: false,
            selectedThree: [],
            // 激活
            activeChecked: 0
          }
				},
				computed: {
					columnsOne: function() {
						return [
              {
                name: 'action',
                label: this.$t('操作'),
                align: 'center'
              },
              {
                name: 'code',
                label: '询价编码',
                align: 'center'
              },
              {
                name: 'title',
                label: '询价主题',
                align: 'center'
              },
              {
                name: 'origin', // 1：手工 2：SOR
                label: '来源',
                align: 'center'
              },
              {
                name: 'isOfficial', // 0：否 1：是 
                label: '是否发布正式',
                align: 'center'
              },
              {
                name: 'isSeal', // (报价截止日期前不可查看供应商报价记录)  0：否 1：是 
                label: '是否密封报价',
                align: 'center'
              },
              {
                name: 'isSignUp', // 0：否 1：是 
                label: '是否需要报名',
                align: 'center'
              },
              {
                name: 'signUpStartTime',
                label: '报名开始时间',
                align: 'center',
                field: 'signUpStartTime',
                sortable: true
              },
              {
                name: 'signUpEndTime',
                label: '报名截止时间',
                align: 'center',
                field: 'signUpEndTime',
                sortable: true
              },
              {
                name: 'approveStatus', // 0:未审核 1：通过 -1：驳回
                label: '审核状态',
                align: 'center'
              },
              {
                name: 'isClose', // 0: 否 1:是 
                label: '关闭状态',
                align: 'center'
              },
              {
                name: 'status', // 0：草稿  1：激活 
                label: 'RFQ状态',
                align: 'center'
              },
              {
                name: 'sorCode',
                label: 'SOR编码',
                align: 'center'
              },
              {
                name: 'proposerName',
                label: '申请人',
                align: 'center'
              },
              {
                name: 'requiredFinishTime',
                label: 'SOR要求定点时间',
                align: 'center',
                field: 'requiredFinishTime',
                sortable: true
              },
              {
                name: 'purExecutorName',
                label: '采购执行人',
                align: 'center'
              },
              {
                name: 'createTime',
                label: '创建时间',
                align: 'center',
                field: 'createTime',
                sortable: true
              },
              {
                name: 'createUserName',
                label: '创建人',
                align: 'center'
              }
						]
          },
          columnsTwo: function() {
						return [
              {
                name: 'action',
                label: this.$t('操作'),
                align: 'center'
              },
              {
                name: 'code',
                label: '询价编码',
                align: 'center'
              },
              {
                name: 'title',
                label: '询价主题',
                align: 'center'
              },
              {
                name: 'origin', // 1：手工 2：SOR
                label: '来源',
                align: 'center'
              },
              {
                name: 'isOfficial', // 0：否 1：是 
                label: '是否发布正式',
                align: 'center'
              },
              {
                name: 'isSeal', // (报价截止日期前不可查看供应商报价记录)  0：否 1：是 
                label: '是否密封报价',
                align: 'center'
              },
              {
                name: 'isSignUp', // 0：否 1：是 
                label: '是否需要报名',
                align: 'center'
              },
              {
                name: 'signUpStartTime',
                label: '报名开始时间',
                align: 'center',
                field: 'signUpStartTime',
                sortable: true
              },
              {
                name: 'signUpEndTime',
                label: '报名截止时间',
                align: 'center',
                field: 'signUpEndTime',
                sortable: true
              },
              {
                name: 'signUpView', 
                label: '报名情况',
                align: 'center'
              },
              {
                name: 'quoteView', 
                label: '报价情况',
                align: 'center'
              },
              {
                name: 'approveStatus', // 0:未审核 1：通过 -1：驳回
                label: '审核状态',
                align: 'center'
              },
              {
                name: 'isClose', // 0: 否 1:是 
                label: '关闭状态',
                align: 'center'
              },
              {
                name: 'status', // 0：草稿  1：激活 
                label: 'RFQ状态',
                align: 'center'
              },
              {
                name: 'sorCode',
                label: 'SOR编码',
                align: 'center'
              },
              {
                name: 'createTime',
                label: '创建时间',
                align: 'center',
                field: 'createTime',
                sortable: true
              },
              {
                name: 'createUserName',
                label: '创建人',
                align: 'center'
              }
						]
          },
          columnsThree: function() {
						return [
              {
                name: 'action',
                label: this.$t('操作'),
                align: 'center'
              },
              {
                name: 'code',
                label: '询价编码',
                align: 'center'
              },
              {
                name: 'title',
                label: '询价主题',
                align: 'center'
              },
              {
                name: 'origin', // 1：手工 2：SOR
                label: '来源',
                align: 'center'
              },
              {
                name: 'isOfficial', // 0：否 1：是 
                label: '是否发布正式',
                align: 'center'
              },
              {
                name: 'isSeal', // (报价截止日期前不可查看供应商报价记录)  0：否 1：是 
                label: '是否密封报价',
                align: 'center'
              },
              {
                name: 'isSignUp', // 0：否 1：是 
                label: '是否需要报名',
                align: 'center'
              },
              {
                name: 'signUpStartTime',
                label: '报名开始时间',
                align: 'center',
                field: 'signUpStartTime',
                sortable: true
              },
              {
                name: 'signUpEndTime',
                label: '报名截止时间',
                align: 'center',
                field: 'signUpEndTime',
                sortable: true
              },
              {
                name: 'signUpView', 
                label: '报名情况',
                align: 'center'
              },
              {
                name: 'quoteView', 
                label: '报价情况',
                align: 'center'
              },
              {
                name: 'approveStatus', // 0:未审核 1：通过 -1：驳回
                label: '审核状态',
                align: 'center'
              },
              {
                name: 'isClose', // 0: 否 1:是 
                label: '关闭状态',
                align: 'center'
              },
              {
                name: 'status', // 0：草稿  1：激活 
                label: 'RFQ状态',
                align: 'center'
              },
              {
                name: 'sorCode',
                label: 'SOR编码',
                align: 'center'
              },
              {
                name: 'requiredFinishTime',
                label: 'SOR要求定点时间',
                align: 'center',
                field: 'requiredFinishTime',
                sortable: true
              },
              {
                name: 'purExecutorName',
                label: '采购执行人',
                align: 'center'
              },
              {
                name: 'createTime',
                label: '创建时间',
                align: 'center',
                field: 'createTime',
                sortable: true
              },
              {
                name: 'createUserName',
                label: '创建人',
                align: 'center'
              }
						]
          },
          pages: function() {
            return Math.ceil(this.total/this.serverPagination.rowsPerPage)
          }
        },
        watch: {
          selectedTab: function(tab) {
            if (tab == 'tab-1') {
              this.tabSearch.key = 'status',
              this.tabSearch.val = 0
            }
            if (tab == 'tab-2') {
              this.tabSearch.key = 'status',
              this.tabSearch.val = 1
            }
            if (tab == 'tab-3') {
              this.tabSearch.key = 'isClose',
              this.tabSearch.val = 1
            }
            this.searchForm = {
              code: '',
              title: '',
              sorCode: ''
            }
            this.listGet({ pagination: this.serverPagination }, this.tabSearch)
          },
          'serverPagination.rowsPerPage': function(rowsPerPage) {
            this.listGet({ pagination: this.serverPagination }, this.tabSearch)
          },
          'serverPagination.page': function(page) {
            this.listGet({ pagination: this.serverPagination }, this.tabSearch)
          }
        },
        created: function() {
          var args = GetRequest()
          this.selectedTab = args.tab? args.tab: 'tab-1'
          this.listGet({ pagination: this.serverPagination }, this.tabSearch)
        },
				methods: {
					listGet: function(arg, tab) {
            var that = this
            this.listLoading = true
            this.visible = true
            this.serverPagination = arg.pagination
            var _data = {
              page: this.serverPagination.page,
              rows: this.serverPagination.rowsPerPage,
              sort: this.serverPagination.sortBy,
              order: this.serverPagination.descending == true? 'desc' : (this.serverPagination.descending == false? 'asc' : null),
              search_LIKE_code: this.searchForm.code,
              search_LIKE_title: this.searchForm.title,
              search_LIKE_sorCode: this.searchForm.sorCode,
            }
            if (tab.key == 'status' && tab.val == 0) {
              _data.search_EQ_status = 0
              _data.search_EQ_isClose = ''
            }
            if (tab.key == 'status' && tab.val == 1) {
              _data.search_GTE_status = 1
              _data.search_EQ_isClose = ''
            }
            if (tab.key == 'isClose') {
              _data.search_EQ_status = ''
              _data.search_EQ_isClose = 1
            }
            axios({
              method: 'post',
              url: '/manager/rfq/main/query',
              data: _data
            })
            .then(function(data) {
              that.tableData = data.rows
              that.total = data.total
              that.listLoading = false
              setTimeout(function() {
                that.visible = false
              }, 500)
              that.btnLoadingSearch = false
              that.btnLoadingReset = false
            })
            .catch(function(err) {
              console.log(err)
            })
          },
          search: function() {
            this.btnLoadingSearch = true
            this.listGet({ pagination: this.serverPagination }, this.tabSearch)
          },
          reset: function() {
            this.btnLoadingReset = true
            this.searchForm = {  
              code: '',
              title: '',
              sorCode: ''
            }
            this.listGet({ pagination: this.serverPagination }, this.tabSearch)
          },
          goMaintenance: function(type, id) {
            if (type == 1) {
              window.location.href = './rfxPurAdd.html?addOrEdit=' + type
            } 
            if (type == 2) {
              window.location.href = './rfxPurAdd.html?addOrEdit=' + type + '&id=' + id
            }
          },
          deleteOne: function() {
            var that = this
            if (this.selectedOne.length > 0) {
              this.$q.dialog({
                title: '确认',
                message: '确认要删除选中的'+ this.selectedOne.length + '条数据吗？',
                ok: {
                  label: '确认',
                  flat: true
                },
                cancel: {
                  label: '取消',
                  flat: true
                }
              })
              .then(function() {
                var idSelected = []
                that.selectedOne.forEach(function(e) {
                  idSelected.push(e.id)
                })
                axios({
                  method: 'post',
                  url: '/manager/rfq/main/delete',
                  data: {
                    ids: idSelected.join(',')
                  }
                })
                .then(function(data) {
                  if (data.success) {
                    that.$q.notify({
                      message: '操作成功',
                      type: 'positive',
                      icon: 'done',
                      timeout: 1000,
                      position: 'top-right'
                    })
                  } else {
                    that.$q.notify({
                      message: data.msg,
                      type: 'negative',
                      icon: 'error_outline',
                      timeout: 1000,
                      position: 'top-right'
                    })
                  }
                  that.selectedOne = []
                  that.listGet({ pagination: that.serverPagination }, that.tabSearch)
                })
                .catch(function(err) {
                  console.log(err)
                })
              })
              .catch(function() {
                // 选择"Cancel"或作了关闭操作
              })
            } else {
              this.$q.notify({
                message: '请先勾选，再执行该操作！',
                type: 'warning',
                icon: 'warning',
                position: 'top-right'
              })
            }
          },
          activate: function() {
            var that = this
            if (this.selectedOne.length > 0) {
              this.$q.dialog({
                title: '确认',
                message: '确认要激活选中的'+ this.selectedOne.length + '条数据吗？',
                ok: {
                  label: '确认',
                  flat: true
                },
                cancel: {
                  label: '取消',
                  flat: true
                },
                options: {
                  type: 'radio', // 或者'checkbox' / 'toggle'
                  model: 0, // 使用数组，当checkbox/toggle时! (like '[]')
                  items: [
                    {label: '普通询价', value: 0 },
                    {label: '正式询价', value: 1 }
                  ]
                }
              })
              .then(function(checked) {
                var idSelected = []
                that.selectedOne.forEach(function(e) {
                  idSelected.push(e.id)
                })
                axios({
                  method: 'post',
                  url: '/manager/rfq/main/active/' + checked,
                  data: {
                    ids: idSelected.join(',')
                  }
                })
                .then(function(data) {
                  if (data.success) {
                    that.$q.notify({
                      message: '操作成功',
                      type: 'positive',
                      icon: 'done',
                      timeout: 1000,
                      position: 'top-right'
                    })
                  } else {
                    that.$q.notify({
                      message: data.msg,
                      type: 'negative',
                      icon: 'error_outline',
                      timeout: 1000,
                      position: 'top-right'
                    })
                  }
                  that.selectedOne = []
                  that.listGet({ pagination: that.serverPagination }, that.tabSearch)
                })
                .catch(function(err) {
                  console.log(err)
                })
              })
              .catch(function() {
                // 选择"Cancel"或作了关闭操作
              })
            } else {
              this.$q.notify({
                message: '请先勾选，再执行该操作！',
                type: 'warning',
                icon: 'warning',
                position: 'top-right'
              })
            }
          },
          close: function() {
            var that = this
            if (this.selectedTwo.length > 0) {
              this.$q.dialog({
                title: '确认',
                message: '确认要关闭选中的'+ this.selectedTwo.length + '条数据吗？',
                ok: {
                  label: '确认',
                  flat: true
                },
                cancel: {
                  label: '取消',
                  flat: true
                }
              })
              .then(function() {
                var idSelected = []
                that.selectedTwo.forEach(function(e) {
                  idSelected.push(e.id)
                })
                axios({
                  method: 'post',
                  url: '/manager/rfq/main/close',
                  data: {
                    ids: idSelected.join(',')
                  }
                })
                .then(function(data) {
                  if (data.success) {
                    that.$q.notify({
                      message: '操作成功',
                      type: 'positive',
                      icon: 'done',
                      timeout: 1000,
                      position: 'top-right'
                    })
                  } else {
                    that.$q.notify({
                      message: data.msg,
                      type: 'negative',
                      icon: 'error_outline',
                      timeout: 1000,
                      position: 'top-right'
                    })
                  }
                  that.selectedTwo = []
                  that.listGet({ pagination: that.serverPagination }, that.tabSearch)
                })
                .catch(function(err) {
                  console.log(err)
                })
              })
              .catch(function() {
                // 选择"Cancel"或作了关闭操作
              })
            } else {
              this.$q.notify({
                message: '请先勾选，再执行该操作！',
                type: 'warning',
                icon: 'warning',
                position: 'top-right'
              })
            }
          },
          comparePrice: function(isSeal, id) {
            if (isSeal) {
              var that = this
              axios({
                method: 'post',
                url: '/manager/rfq/main/validateQuoteEndTime/'+id,
              })
              .then(function(data) {
                if (data.success) {
                  window.location.href = './rfxPurCompare.html?id='+id
                } else {
                  that.$q.notify({
                    message: data.msg,
                    type: 'negative',
                    icon: 'error_outline',
                    timeout: 2000,
                    position: 'top-right'
                  })
                }
              })
              .catch(function(err) {
                console.log(err)
              })
            } else {
              window.location.href = './rfxPurCompare.html?id='+id
            }
          } 
				}
			})
    </script>
  </body>
</html>